﻿using Archiecture.API.Application.Commands.SupplierCommand;
using Architecture.Domain.Dto.Source;
using Architercture.Domain.Service.IService;
using MediatR;

namespace Archiecture.API.Application.CommandHandlers.SupplierCommandHandler
{
    public class GetSupplierListCommandHandler : IRequestHandler<GetSupplierListCommand, List<ImgDto>>
    {
        private readonly ISupplierService _supplierService;

        public GetSupplierListCommandHandler(ISupplierService supplierService)
        {
            _supplierService = supplierService;
        }

        public async Task<List<ImgDto>> Handle(GetSupplierListCommand request, CancellationToken cancellationToken)
        {
            return await _supplierService.GetSupplierImage(request.batchCode, request.code);
        }
    }
}
